#include <stdio.h>
#include <iostream>
using namespace std;

void swap(int* x, int* y)
{
    int t = *x; *x = *y; *y = t;
}

void QuickSort(int* arr, int left, int right)
{
    if (left >= right) return;
    int begin = left, end = right;
    int cur = left;
    int key = arr[left];
    while (cur <= right)
    {
        if (key < arr[cur]) swap(&arr[cur++], &arr[left++]);
        else if (key > arr[cur]) swap(&arr[cur], &arr[right--]);
        else cur++;
    }
    int i = 0;
    for (i = 0; i <= 9; i++)
    {
        printf("%d ", arr[i]);
    }
    printf("\n");
    QuickSort(arr, begin, left - 1);
    QuickSort(arr, right + 1, end);
}

int main()
{
    int arr[10] = { 0 };
    for (int i = 0; i < 10; i++)
    {
        cin >> arr[i];
    }
    QuickSort(arr, 0, 9);
    for (int i = 0; i < 10; i++)
    {
        cout << arr[i] << ' ';
    }
    return 0;
}